
//
//  Person.m
//  TestRunTime
//
//  Created by 吴志勇 on 2020/3/23.
//  Copyright © 2020 wzy. All rights reserved.
//

#import "Person.h"
#import <objc/message.h>

@implementation Person

void aa(id self,SEL _cmd){
    NSLog(@"动态添加函数");
}

+ (BOOL)resolveInstanceMethod:(SEL)sel{
    if (sel == NSSelectorFromString(@"eat")) {
        class_addMethod(self, sel, (IMP)aa, "v@:");
    }
    return [super resolveInstanceMethod:sel];
}


@end
